package com.keyin.protocol;

import java.util.ArrayList;
import java.util.List;

import org.json.JSONArray;
import org.json.JSONObject;

import com.keyin.android.util.ReflectionFactory;

public class Magazines extends JsonBean {
	public List<MagazineBean> magazines = new ArrayList<MagazineBean>();

	@Override
	public JsonBean parse(JSONObject jsonObj) throws Exception {

		JSONArray array = jsonObj.getJSONArray("magazines");
		for (int i = 0; i < array.length(); i++) {
			MagazineBean nm = (MagazineBean) ReflectionFactory.create(
					array.getJSONObject(i), MagazineBean.class);

			magazines.add(nm);
		}

		return super.parse(jsonObj);
	}
}
